﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace QuanLyThuoc
{
    class NhomThuoc
    {
        string maNhomThuoc;
        string tenNhomThuoc;

        public string MaNhomThuoc
        {
            get { return maNhomThuoc; }
            set { maNhomThuoc = value; }
        }
        public string TenNhomThuoc
        {
            get { return tenNhomThuoc; }
            set { tenNhomThuoc = value; }
        }

        public NhomThuoc() //ham thiet lap 0 tham so
        { }

        public NhomThuoc(string maNhomThuoc, string tenNhomThuoc)//ham thiet lap
        {
            this.maNhomThuoc = maNhomThuoc;
            this.tenNhomThuoc = tenNhomThuoc;
        }

        public void NhapNT()
        {
            Console.Write("\nNhap vao ma nhom thuoc: ");
            maNhomThuoc = Console.ReadLine();
            Console.Write("Nhap ten nhom thuoc: ");
            tenNhomThuoc = Console.ReadLine();
        }

        public void XuatNT()
        {
            Console.Write("\n\t" + maNhomThuoc);
            Console.Write("\t" + tenNhomThuoc);
        }

        public void ghiFileNT()
        {
            FileStream dsNT = new FileStream("nhomthuoc.txt", FileMode.Append);
            BinaryWriter ghi = new BinaryWriter(dsNT);
            ghi.Write(maNhomThuoc);
            ghi.Write(tenNhomThuoc);
            ghi.Close();
            dsNT.Close();
        }
    }
}
